//
//  AppDelegate.swift
//  status
//
//  Created by 彳亍 on 2017/3/22.
//  Copyright © 2017年 彳亍. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        // 1. 设置根控制器
        setupRootVC()
        
        
        return true
    }

}

// MARK: - extension
fileprivate extension AppDelegate {
    
    /// 设置根控制器
    func setupRootVC() {
        // 1. 初始化窗口
        window = UIWindow(frame: UIScreen.main.bounds)
        // 2. 设置根控制器
        window?.rootViewController = CHMainController()
        // 3. 设置主窗口并可见
        window?.makeKeyAndVisible()
    }
    
    
}
